package daobeauty.interceptor.returntype.executor.criteria;

import org.hibernate.Criteria;

import daobeauty.dao.Limiting;
import daobeauty.dao.Sorting;
import daobeauty.interceptor.returntype.handler.ReturnTypeHandler;

/**
 * This interface defines a strategy for executing Criterias.
 * The given ReturnTypeHandler is responsible of converting the result of the query
 * to the type, which the proxied method has to return.
 * Also the Limiting has to be applied to the Criteria.<br/>
 * Different execution strategies may consist of calling Criteria.list(), Criteria.uniqueResult() or Criteria.scroll().
 * 
 * @author M. Serhat Cinar
 *
 */
public interface CriteriaExecutionStrategy {
	public Object execute(ReturnTypeHandler returnTypeHandler, Criteria criteria, Limiting limiting, Sorting sorting);
}
